package com.training.java.core.collections.maps;


import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class MapDemo {

	public static void main(String[] args) {

		 Map<String, String> directory = new HashMap<>();
	     directory.put("Mira", "Apple");
	     directory.put("Satya", "Mango");
	     directory.put("Suneetha", "Grape");
	     directory.put("Shiva", "Banana");
	     directory.put("Sushil", "Kiwi");
	     directory.put("Henry", "Cherrey");
	     directory.put("reenu", "WaterMelon");
	     
	     String mFruit = directory.get("Mira");
	     String stFruit = directory.get("Satya");
	     String suFruit = directory.get("Suneetha");
	     
	     System.out.println("Mira's favorite fruit is: " + mFruit);
	     System.out.println("Satya's favorite fruit is: " + stFruit);
	     System.out.println("Suneetha's favorite fruit is: " + suFruit);
	     System.out.println("****************");
	     
	     
	     Set<Entry<String, String>> entries = directory.entrySet();
	     
	     for(Entry<String, String> entry:entries)
	     {
	    	 System.out.println( entry.getKey()  + " : " + entry.getValue());
	    	 
	     }
		
	}

}
